Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages #1134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

csillag
Copy link
Contributor

@csillag csillag commented Jan 5, 2024

Always try to properly differentiate between:

  • Illegal request (wrong address etc)
  • Failure to load data
  • Data not found
Situation Before After
Can't load block details block_before_cant_load block_after_cant_load
Can't load TX details tx_before_cant_load tx_after_cant_load
Can't load Token data token_before_cant_load token_after_cant_load
Token does not exist token_before_not_found token_after_not_found

Copy link

github-actions bot commented Jan 5, 2024

Deployed to Cloudflare Pages

Latest commit: fe7fce9a4b0c37cb0769a966cc044d0009f52bfb
Status:✅ Deploy successful!
Preview URL: https://46807111.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/better-error-messages branch from 92d764e to cca9d7d Compare January 5, 2024 14:54
@csillag csillag marked this pull request as ready for review January 5, 2024 14:55
@csillag csillag force-pushed the csillag/better-error-messages branch from cca9d7d to 2504455 Compare January 5, 2024 17:07
@@ -152,6 +152,8 @@
"value": "{{value, number}}"
},
"errors": {
"canNotLoadData": "Can not load data",
"canNotReachDataSource": "We were unable to reach the data source to request this data. This is probably a temporary (network?) problem. Please try again later.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(network?)"

should we avoid the word "network" and use connection/connectivity?

cc @donouwens

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Friendly reminder: this is waiting for input from @donouwens

data: 'not found',
headers: {},
})
return undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +43 to +44
// TODO: look for other error codes, too.
// (Currently we are not aware of anything else)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others: https://github.com/axios/axios/blob/6d4c421/README.md#error-types

ETIMEDOUT, ECONNABORTED, ERR_BAD_RESPONSE would indicate backend issue

Always try to properly differentiate between:
 - Illegal request (wrong address etc)
 - Failure to load data
 - Data not found
@csillag csillag force-pushed the csillag/better-error-messages branch from 2504455 to fe7fce9 Compare January 27, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants